__author__ = 'YANXIU'

# -*- coding: utf-8 -*-
import requests
import lxml.etree as etree

# head = { 'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36'}
# url = 'http://weixin.sogou.com/weixin?type=1&query=%E5%B0%8F%E8%A5%BF%E7%9A%84%E7%AC%94%E8%AE%B0&ie=utf8&_sug_=n&_sug_type_='
# html = requests.get(url,headers=head).text
# print(html)


head = { 'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36'}
url = 'http://weixin.sogou.com/weixin?type=1&query=%E5%B0%8F%E8%A5%BF%E7%9A%84%E7%AC%94%E8%AE%B0&ie=utf8&_sug_=n&_sug_type_='
mhtml = requests.get(url,headers=head).text
print(mhtml)
html = requests.get(url,headers=head).content
selector = etree.HTML(html)
content = selector.xpath('//*[@id="sogou_vr_11002301_box_2"]')
for each in content:
    print(each)

